// app.js
import './utils/utils.js'
import './utils/http.js'
App({
  globalData: {},
  onLaunch() {
    this.token = wx.getStorageSync('token')
    this.refreshToken = wx.getStorageSync('refreshToken')
  },
  setToken(token) {
    wx.setStorageSync('token', token)
    this.token = token
  },
  setRefreshToken(refreshToken) {
    wx.setStorageSync('refreshToken', refreshToken)
    this.refreshToken = refreshToken
  },
  getToke() {
    return wx.getStorageSync('token')
  },
  getRefreshToken() {
    return wx.getStorageSync('refreshToken')
  },
  logout() {
    wx.removeStorageSync('token')
    wx.removeStorageSync('refreshToken')
    this.token = null
    this.refreshToken = null
    wx,wx.switchTab({
      url: '/pages/index/index',
    })
  }
})
